package com.demo.security.service;

import java.util.HashSet;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.demo.security.entity.SysUser;
import com.demo.security.service.test.AaService;
import com.demo.security.service.test.BaseServiceImpl;

@Service
public class UserServiceImpl extends BaseServiceImpl implements UserService {

    @Autowired
    private AaService aaService;
    
    @Override
    public SysUser findByUsername(String username) {
        SysUser user = new SysUser();
        user.setId(1L);
        user.setUsername(username);
        user.setPassword("123456");
        return user;
    }

    @Override
    public Set<String> findPermissions(String username) {
        Set<String> permissions = new HashSet<>();
        permissions.add("sys:user:view");
        permissions.add("sys:user:add");
        permissions.add("sys:user:edit");
        permissions.add("sys:user:delete");
        return permissions;
    }

}